import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LgtypeConfigVO, LgtypeConfigForm, LgtypeConfigQuery } from '@/api/system/lgtypeConfig/types';

/**
 * 查询登录方式配置列表
 * @param query
 * @returns {*}
 */

export const listLgtypeConfig = (query?: LgtypeConfigQuery): AxiosPromise<LgtypeConfigVO[]> => {
  return request({
    url: '/system/lgtypeConfig/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询登录方式配置详细
 * @param id
 */
export const getLgtypeConfig = (id: string | number): AxiosPromise<LgtypeConfigVO> => {
  return request({
    url: '/system/lgtypeConfig/' + id,
    method: 'get'
  });
};

/**
 * 新增登录方式配置
 * @param data
 */
export const addLgtypeConfig = (data: LgtypeConfigForm) => {
  return request({
    url: '/system/lgtypeConfig',
    method: 'post',
    data: data
  });
};

/**
 * 修改登录方式配置
 * @param data
 */
export const updateLgtypeConfig = (data: LgtypeConfigForm) => {
  return request({
    url: '/system/lgtypeConfig',
    method: 'put',
    data: data
  });
};

/**
 * 删除登录方式配置
 * @param id
 */
export const delLgtypeConfig = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/lgtypeConfig/' + id,
    method: 'delete'
  });
};
